package com.erdos.message.command;

import java.io.Serializable;

import com.erdos.message.Messaging;

public interface ServiceInvocation extends Messaging {
	/**
	 * for the business module to implements to complete the business logic.
	 * if no value return or no need to return, return a <code>null</code>.
	 * if need to return the value to the message sender, this method must provide the return value.
	 * @param msgTypeId message type id
	 * @param entity parameter to be cast to the desired class type, received message object
	 * @return a serializable object, if no value returns, returns a <code>null</code>
	 * @throws ServiceInvocationException thrown if failed to complete the business logic
	 */
	public Serializable execute(String msgTypeId, Object entity) throws ServiceInvocationException;
}
